package com.java.test.rest.http.async;


import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 包装了具体的请求信息 <br>
 * 
 * 其中的每一个Concreate对应一个具体的请求，baseEnum 对应业务标识，variables为请求的额外参数，request为请求类和响应类组成的map
 *
 * @author http://blog.csdn.net/pistolove/article/details/51428562
 *
 * @date 2017年11月25日下午7:09:51
 */
public class ConcreateWapper {
    private List<Concreate> wrapper = new ArrayList<Concreate>();

    public ConcreateWapper() {}

    public void setParams(IEnum baseEnum, Map<String, ?> variables, Map<BaseRequest, ?> request) {
        wrapper.add(new Concreate(baseEnum, variables, request));
    }

    public List<Concreate> getWrapper() {
        return wrapper;
    }

    public static class Concreate {
        private IEnum baseEnum;
        private Map<String, ?> variables;
        private Map<BaseRequest, ?> request;

        /**
         * 具体的请求信息
         * 
         * @param baseEnum 业务标识
         * @param variables 请求的额外参数
         * @param request 请求类和响应类组成的map
         */
        public Concreate(IEnum baseEnum, Map<String, ?> variables, Map<BaseRequest, ?> request) {
            this.baseEnum = baseEnum;
            this.variables = variables;
            this.request = request;
        }

        public IEnum getBaseEnum() {
            return baseEnum;
        }

        public void setBaseEnum(IEnum baseEnum) {
            this.baseEnum = baseEnum;
        }

        public Map<String, ?> getVariables() {
            return variables;
        }

        public void setVariables(Map<String, ?> variables) {
            this.variables = variables;
        }

        public Map<BaseRequest, ?> getRequest() {
            return request;
        }

        public void setRequest(Map<BaseRequest, ?> request) {
            this.request = request;
        }
    }
}
